﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class TempOdGiTransformed : OdGiWorldDrawImpl
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public TempOdGiTransformed(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.TempOdGiTransformed_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(TempOdGiTransformed obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.deletePD_TempOdGiTransformed(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new void pushModelTransform(OdGeMatrix3d xMat)
		{
			GlobalsPINVOKE.TempOdGiTransformed_pushModelTransform__SWIG_0(this.swigCPtr, OdGeMatrix3d.getCPtr(xMat));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void pushModelTransform(OdGeVector3d vNormal)
		{
			GlobalsPINVOKE.TempOdGiTransformed_pushModelTransform__SWIG_1(this.swigCPtr, OdGeVector3d.getCPtr(vNormal));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void popModelTransform()
		{
			GlobalsPINVOKE.TempOdGiTransformed_popModelTransform(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new OdGeMatrix3d getModelToWorldTransform()
		{
			OdGeMatrix3d result = new OdGeMatrix3d(GlobalsPINVOKE.TempOdGiTransformed_getModelToWorldTransform(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new OdGeMatrix3d getWorldToModelTransform()
		{
			OdGeMatrix3d result = new OdGeMatrix3d(GlobalsPINVOKE.TempOdGiTransformed_getWorldToModelTransform(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
